home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_01
/
1001024a
< prev
next >
Wrap
Text File
|
1991-11-16
|
1KB
|
40 lines
//////////////////////////////////////////////////////
// LISTCLAS.H
//
// D_List Class - Similar to list class
// developed for CUJ July, 1990
//
// Dave's List.
//
//////////////////////////////////////////////////////
#ifndef LISTCLAS_H
#define LISTCLAS_H
#include <stdio.h>
enum Boolean {false, true};
class D_List {
public:
virtual Boolean at_top()
{ return ((Boolean) (tell() == 0L));}
virtual Boolean at_end() = 0;
virtual Boolean is_empty()
{ return ((Boolean) (total() == 0L)); }
virtual Boolean find(void *key) = 0;
virtual void prev() = 0,
next() = 0,
seek(long where, int start),
top() = 0,
end() = 0,
add() = 0,
replace(void *member) = 0,
remove() = 0;
virtual void *current() = 0;
long virtual total(),
tell() = 0;
void * operator[] (long where)
{ seek(where,SEEK_SET); return current(); }
void * operator[] (void *key)
{ return (find(key) ? current() : NULL); }
};
#endif